 <input type="hidden" id="token" value="{{csrf_token()}}">
<form action="login" method="post">
   @csrf
    姓名：<input type="text" name="username">
    密码：<input type="password" name="password">

</form>
 <button id="sub">submit</button>
 <script type="text/javascript" src="http://www.xbiao.com/js/lib/jquery-1.7.2.min.js"></script>

 <script>

     $("#sub").click(function () {
         $.ajax({
             url:"login",
             type:"post",
             data:{
                 username:"111"
             },
             headers:{
                 'X-CSRF-TOKEN':$("#token").val()
             }
         })
     });

 </script>